package com.zky.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.zky.DAO.impl.UsersDaoImp;
import com.zky.entity.Users;

public class RegistAction extends UsersDaoImp{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public Users users;
	HttpServletRequest request = ServletActionContext.getRequest(); 
	HttpServletRequest session = ServletActionContext.getRequest();
	HttpSession s = request.getSession();
	public Users getUsers() {
		return users;
	}

	public void setUsers(Users users) {
		this.users = users;
	}
	
	public String add(){
		 try{
			 s.setAttribute("username", users.getUsername());
		this.save(users);
		return "success";
		 }catch(Exception e){
			    e.printStackTrace();
			    return "false";
			   }
	
		
	}
	
	

}
